package com.jie.client.service.ui;

import com.jie.client.core.ClientApplication;
import com.jie.client.service.ui.constant.ViewMapConstant;
import com.jie.client.service.ui.view.LoginView;
import javafx.application.Application;
import javafx.stage.Stage;

/**
 * @author XieZhiJie
 * @date 2022/04/27 20:55
 */
public class ViewStarter extends Application {

    public void start() {
        launch();
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        // 关掉窗口的时候关闭所有线程
        primaryStage.setOnCloseRequest(event -> System.exit(0));
        primaryStage.setTitle("登录");
        primaryStage.setScene(new LoginView().getLoginScene());
        primaryStage.show();
        ClientApplication.VIEW_MAP.put(ViewMapConstant.MAIN_STAGE, primaryStage);
    }

}
